import Vue from 'vue';
import VueCompositionAPI from '@vue/composition-api';
import { PiniaPlugin, createPinia } from 'pinia';
import ECharts from 'vue-echarts';
import App from './App.vue';

import router from './router';

import 'normalize.css/normalize.css'; // a modern alternative to CSS resets
import 'nprogress/nprogress.css'; // nprogress
import 'ant-design-vue/dist/antd.css'; // antd样式
import './styles/index.less';
import './styles/tailwind.css';

import '@/directives/index';

import { registerAntd } from '@/utils/register-antd';
import { registerCharts } from '@/utils/register-charts';
import { registerVxeTable } from '@/utils/register-vxe-table';
import { registerComponents } from '@/components';
import { registerIcons } from '@/icons';

Vue.use(VueCompositionAPI);
Vue.use(PiniaPlugin);

Vue.component('VChart', ECharts);

// 注册antd,echarts,vxe，svg组件
registerAntd();
registerCharts();
registerVxeTable();
registerIcons();

// 注册全局组件
registerComponents();

Vue.config.productionTip = false;

// 创建pinia store
const pinia = createPinia();

new Vue({
  router,
  pinia,
  render: (h) => h(App),
}).$mount('#app');
